<template>
  <div class="about">
    <p>我是a模块的变量：{{numA}}</p>
    <p>我是b模块的变量：{{numB}}</p>
    <button @click="addA">A++</button>
    <button @click="addB">B++</button>
  </div>
</template>
<script>
import { mapState,mapMutations } from 'vuex';
export default {
  created() {
    console.log(this.$store);
  },
  computed:{
    ...mapState({
      numA: state => state.a.num,
      numB: state => state.b.num,
    })
  },
  methods: {
    // ...mapMutations('a',['comNum'])
    ...mapMutations({
      addA: 'a/comNum',
      addB: 'b/comNum'
    })
  },
}
</script>